package com.gosuncn.zfysdk.demo.ui.appservice;

import android.Manifest;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.navigation.fragment.NavHostFragment;

import com.gosuncn.zfysdk.demo.R;
import com.gosuncn.zfysdk.demo.base.BaseFragment;
import com.gosuncn.zfysdk.demo.databinding.FragmentAppServiceBinding;
import com.gosuncn.zfysdk.demo.databinding.FragmentHomeBinding;
import com.gosuncn.zfysdk.demo.ui.MainFragment;
import com.gosuncn.zfysdk.demo.ui.MainViewModel;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wzq.mvvmsmart.http.DownLoadManager;
import com.wzq.mvvmsmart.http.download.ProgressCallBack;
import com.wzq.mvvmsmart.utils.KLog;
import com.wzq.mvvmsmart.utils.ToastUtils;

import ga.mdm.PolicyManager.PolicyManager;
import io.reactivex.functions.Consumer;
import okhttp3.ResponseBody;

public class AppServiceFragment extends BaseFragment<FragmentAppServiceBinding, MainViewModel> {

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_app_service;
    }

    @Override
    public int initVariableId() {
        return com.gosuncn.zfysdk.demo.BR.viewModel;
    }


    @Override
    public void initData() {
        super.initData();
        binding.setPresenter(new AppServiceFragment.Presenter());
    }

    @Override
    public void initViewObservable() {
        super.initViewObservable();
    }

    /**
     * 封装布局中的点击事件儿;
     */
    public class Presenter {

        //get imei
        public void onGetImeiClicked() {
            String imeiStr = PolicyManager.getInstance().getImei(getContext());
            ToastUtils.showLong("IMEI: " + imeiStr);
        }

        //get iccid
        public void onGetIccidClicked() {
            ToastUtils.showLong("ICCID: ");
        }

    }

}
